﻿using ReflectionStudio.Core.Events;
using System;
using System.ComponentModel;
using System.Data;
using System.Windows;
using WPFExcelReport.Helpers;
namespace WPFExcelReport
{
    public partial class UIVAF : ViewBase
    {


        TWAFARBEN cWSF
        {
            get
            {
                return (TWAFARBEN)this.FindName("cWF");
            }
        }

        public UIVAF()
        {

            MESSAGES += "WF2VF;";
        }

        public virtual void OnVAFChg(DataRow row)
        {
            if (row == null)
            {

                return;
            }

        }
        public override void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            base.Window_Loaded(sender, e); 
        }


        public virtual void OnVARTChg(string value)
        {
        }

        /// <summary>
        /// 同一个生产品种可能对应多个VA10
        /// </summary>
        /// <param name="value"></param>
        public virtual void OnLSARTChg(string value)
        {
        }

         
        public void Insert(DataRow _dwVF)
        {
            try
            {
                _dwVF["VAFMANDANT"] = app.Mandant;
                if (dwVA == null)
                {
                    dwData = TMV.VAA.TBMain.NewRow();
                    dwData["VAAMANDANT"] = app.Mandant;
                    dwData["VAAKOLL"] = _dwVF["VAFKOLL"];
                    dwData["VAAART"] = _dwVF["VAFART"];
                    SResult = TMV.VAA.QVA02(dwData);
                    if (SResult.Tables[0].Rows.Count > 0)
                        dwVA = SResult.Tables[0].Rows[0];
                }
                if (dwVA != null)
                {
                    _dwVF["VAFPART"] = dwVA["VAADART"];
                    _dwVF["VAFPLART"] = dwVA["VAADART"];
                    _dwVF["VAFPART"] = dwVA["VAADART"];
                    _dwVF["VAFPVAR"] = dwVA["VAADVAR"];
                }

                else
                {
                    _dwVF["VAFPART"] = _dwVF["VAFART"].ToString().Substring(0, 20);
                    _dwVF["VAFPLART"] = _dwVF["VAFART"].ToString().Substring(0, 20);
                    _dwVF["VAFPART"] = _dwVF["VAFART"].ToString().Substring(0, 20);
                    _dwVF["VAFPVAR"] = "  ";
                }

                TMV.InsertVAFARBEN(_dwVF, app.company);
                TBMain.Rows.InsertAt(_dwVF, 0);
                vwMaster.View.MoveCurrentToFirst();
                /*
                string key = _dwVF["VAFKOLL"].ToString() + _dwVF["VAFART"].ToString() + _dwVF["VAFFARBE"].ToString();
                SResult = TMV.QVAF02(_dwVF);
                MergeData(SResult, false, false);
                Locate("KEY", key);*/

            }
            catch (Exception ex)
            {
                Tracer.Error(ex.StackTrace, ex);
            }
        }
        public override void ManageCommand(object sender, RoutedEventArgs e)
        {
            if (IsManage)
            {
                OnEXAUFChg(KEY);
            }
            else
            {
                VICC_WFEVENTS.SVWF.VA09(RUNID, KEY);
            }
            base.ManageCommand(sender, e);
        }
        public override void OnNewChg()
        {
            base.OnNewChg();
        }

        public override void EditCommand(object sender, System.Windows.RoutedEventArgs e)
        {
            base.EditCommand(sender, e);
        }

        public override void DeleteCommand(object sender, System.Windows.RoutedEventArgs e)
        {
            base.DeleteCommand(sender, e);
            if (dwMaster == null)
                return;
            TMV.DeleteVAFARBEN(dwMaster, 1);
            string _VAFKOLL = dwMaster["VAFKOLL"].ToString();
            string _VAFART = dwMaster["VAFART"].ToString();
            string _VAFFARBE = dwMaster["VAFFARBE"].ToString();
            vwMaster.View.MoveCurrentTo(-1);
            string filter = "VAFKOLL='" + _VAFKOLL + "' AND VAFART='" + _VAFART + "' AND VAFFARBE='" + _VAFFARBE + "'";
            DataRow[] rows = TBMain.Select(filter);
            foreach (DataRow row in rows)
            {
                row.Delete();
            }
            TBMain.AcceptChanges();
        }

     

        public override void Update()
        {
            foreach(DataRow row in TBMain.Rows)
            {
                if (row.RowState == DataRowState.Unchanged)
                    continue;
                TMV.UpdateVAFARBEN(row, app.company, 0);
            } 
        } 
        public override void SaveCommand(object sender, System.Windows.RoutedEventArgs e)
        {
            if (dwMaster == null)
                return;
            try
            {
                Update(); 
                base.SaveCommand(sender, e);
            }
            catch (Exception ex)
            {
                Tracer.Error(ex.StackTrace, ex);
            }
        }

        public override void Query_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)
        {
            if (e.Key != System.Windows.Input.Key.Enter)
                return;
            TMV.VFLOAD();
        }

        public override void LOADBYAUF()
        {
            base.LOADBYAUF();
            if (ORDERNUM.Length < 39)
                return;
            dwData = TBMain.NewRow();
            dwData["VAFMANDANT"] = app.Mandant;
            dwData["VAFKOLL"] = ORDERNUM.Substring(0, 5);
            dwData["VAFART"] = ORDERNUM.Substring(5, 24);
            dwData["VAFFARBE"] = ORDERNUM.Substring(29, 10);
            SResult = TMV.QVAF02(dwData);
            MergeData(SResult, true, true);
        }
    }
    public partial class UIVAF : ViewBase
    {
        public VVAFARBEN TMV
        {
            get
            {
                return (VVAFARBEN)MV;
            }
        }
        #region ==CRGB===========
        public static readonly DependencyProperty CRGBProperty = DependencyProperty.Register("CRGB",
            typeof(string), typeof(UIVAF),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnCRGBChanged));
        public string CRGB
        {
            get
            {
                return (string)GetValue(CRGBProperty);
            }
            set
            {
                SetValue(CRGBProperty, value);
            }
        }
        private static void OnCRGBChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIVAF;
            if (src != null)
            {
                src.CRGB = (string)e.NewValue;
                if (src.dwMaster == null)
                    return;
                if (!src.TBMain.Columns.Contains("RGB"))
                    return;
                src.dwMaster["RGB"]= (string)e.NewValue;
            }
        }
        #endregion

        #region ==IsKOLLManage===========
        public static readonly DependencyProperty IsKOLLManageProperty = DependencyProperty.Register("IsKOLLManage",
        typeof(bool), typeof(UIVAF),
        new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsKOLLManageChanged));
        public bool IsKOLLManage
        {
            get
            {
                return (bool)GetValue(IsKOLLManageProperty);
            }
            set
            {
                SetValue(IsKOLLManageProperty, value);
            }
        }
        private static void OnIsKOLLManageChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIVAF;
            if (src != null)
            {
                src.IsKOLLManage = (bool)e.NewValue;
                src.OnIsKOLLManageChg((bool)e.NewValue);
            }
        }
        public virtual void OnIsKOLLManageChg(bool value)
        {

        }
        #endregion

        #region ==IsColorManage===========
        public static readonly DependencyProperty IsColorManageProperty = DependencyProperty.Register("IsColorManage",
        typeof(bool), typeof(UIVAF),
        new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsColorManageChanged));
        public bool IsColorManage
        {
            get
            {
                return (bool)GetValue(IsColorManageProperty);
            }
            set
            {
                SetValue(IsColorManageProperty, value);
            }
        }
        private static void OnIsColorManageChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIVAF;
            if (src != null)
            {
                src.IsColorManage = (bool)e.NewValue;
                src.OnIsColorManageChg((bool)e.NewValue);
            }
        }
        public virtual void OnIsColorManageChg(bool value)
        {

        }
        #endregion

        #region ==IsShowTxt===========
        public static readonly DependencyProperty IsShowTxtProperty = DependencyProperty.Register("IsShowTxt",
            typeof(bool), typeof(UIVAF),
            new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsShowTxtChanged));
        public bool IsShowTxt
        {
            get
            {
                return (bool)GetValue(IsShowTxtProperty);
            }
            set
            {
                SetValue(IsShowTxtProperty, value);
            }
        }
        private static void OnIsShowTxtChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIVAF;
            if (src != null)
            {
                src.IsShowTxt = (bool)e.NewValue;
            }
        }
        #endregion

        #region ==dwVF===========
        public static readonly DependencyProperty dwVFProperty = DependencyProperty.Register("dwVF",
            typeof(DataRow), typeof(UIVAF),
            new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OndwVFChanged));
        public DataRow dwVF
        {
            get
            {
                return (DataRow)GetValue(dwVFProperty);
            }
            set
            {
                SetValue(dwVFProperty, value);
                if (MV == null)
                    return;
                TMV.dwVF = value;
            }
        }
        private static void OndwVFChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIVAF;
            if (src != null)
            {
                src.dwVF = (DataRow)e.NewValue;
            }
        }
        #endregion

        #region ==CART===========
        public static readonly DependencyProperty CARTProperty = DependencyProperty.Register("CART",
            typeof(string), typeof(UIVAF),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnCARTChanged));
        public string CART
        {
            get
            {
                return (string)GetValue(CARTProperty);
            }
            set
            {
                SetValue(CARTProperty, value);
                OnCARTChg(value);
            }
        }
        private static void OnCARTChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIVAF;
            if (src != null)
            {
                src.CART = (string)e.NewValue;
            }
        }
        public virtual void OnCARTChg(string value)
        { }
        #endregion

        #region ==dwVA===========
        public static readonly DependencyProperty dwVAProperty = DependencyProperty.Register("dwVA",
            typeof(DataRow), typeof(UIVAF),
            new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OndwVAChanged));
        public DataRow dwVA
        {
            get
            {
                return (DataRow)GetValue(dwVAProperty);
            }
            set
            {
                SetValue(dwVAProperty, value);
                if (MV == null)
                    return;
                TMV.dwVA = value;
            }
        }
        private static void OndwVAChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIVAF;
            if (src != null)
            {
                src.dwVA = (DataRow)e.NewValue;
            }
        }
        #endregion 

        #region ==PRART===========
        public static readonly DependencyProperty PRARTProperty = DependencyProperty.Register("PRART",
            typeof(string), typeof(UIVAF),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnPRARTChanged));
        public string PRART
        {
            get
            {
                return (string)GetValue(PRARTProperty);
            }
            set
            {
                SetValue(PRARTProperty, value);
            }
        }
        private static void OnPRARTChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIVAF;
            if (src != null)
            {
                src.PRART = (string)e.NewValue;
            }
        }
        #endregion

        #region ==EXFARBE===========
        public static readonly DependencyProperty EXFARBEProperty = DependencyProperty.Register("EXFARBE",
            typeof(string), typeof(UIVAF),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnEXFARBEChanged));
        public string EXFARBE
        {
            get
            {
                return TMV.EXFARBE;
            }
            set
            {
                SetValue(EXFARBEProperty, value);
                if (MV == null)
                    return;
                TMV.EXFARBE = value;
            }
        }
        private static void OnEXFARBEChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIVAF;
            if (src != null)
            {
                src.EXFARBE = (string)e.NewValue;
            }
        }
        #endregion

        #region ==VAFFARBE===========
        public static readonly DependencyProperty VAFFARBEProperty = DependencyProperty.Register("VAFFARBE",
            typeof(string), typeof(UIVAF),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnVAFFARBEChanged));
        public string VAFFARBE
        {
            get
            {
                return (string)GetValue(VAFFARBEProperty);
            }
            set
            {
                SetValue(VAFFARBEProperty, value);
            }
        }
        private static void OnVAFFARBEChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIVAF;
            if (src != null)
            {
                src.VAFFARBE = (string)e.NewValue;
            }
        }
        #endregion

        #region ==VAF===========
        public static readonly DependencyProperty VAFProperty = DependencyProperty.Register("VAF",
            typeof(string), typeof(UIVAF),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnVAFChanged));
        public string VAF
        {
            get
            {
                return (string)GetValue(VAFProperty);
            }
            set
            {
                SetValue(VAFProperty, value);
            }
        }
        private static void OnVAFChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIVAF;
            if (src != null)
            {
                src.VAF = (string)e.NewValue;
            }
        }
        #endregion

        #region ==COLORS===========
        public static readonly DependencyProperty COLORSProperty = DependencyProperty.Register("COLORS",
            typeof(string), typeof(UIVAF),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnCOLORSChanged));
        public string COLORS
        {
            get
            {
                return (string)GetValue(COLORSProperty);
            }
            set
            {
                SetValue(COLORSProperty, value);
                if (MV == null)
                    return;
                TMV.COLORS = value;

            }
        }
        private static void OnCOLORSChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIVAF;
            if (src != null)
            {
                src.COLORS = (string)e.NewValue;
            }
        }
        #endregion

        #region ==VAFBEZ===========
        public static readonly DependencyProperty VAFBEZProperty = DependencyProperty.Register("VAFBEZ",
            typeof(string), typeof(UIVAF),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnVAFBEZChanged));
        public string VAFBEZ
        {
            get
            {
                return (string)GetValue(VAFBEZProperty);
            }
            set
            {
                SetValue(VAFBEZProperty, value);
                if (MV == null)
                    return;
                TMV.VAFBEZ = value;

            }
        }
        private static void OnVAFBEZChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIVAF;
            if (src != null)
            {
                src.VAFBEZ = (string)e.NewValue;
            }
        }
        #endregion

        #region ==IsByCards===========
        public static readonly DependencyProperty IsByCardsProperty = DependencyProperty.Register("IsByCards",
            typeof(bool), typeof(UIVAF),
            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsByCardsChanged));
        public bool IsByCards
        {
            get
            {
                return (bool)GetValue(IsByCardsProperty);
            }
            set
            {
                SetValue(IsByCardsProperty, value);
                if (MV == null)
                    return;
                TMV.IsByCards = value;
            }
        }
        private static void OnIsByCardsChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIVAF;
            if (src != null)
            {
                src.IsByCards = (bool)e.NewValue;
            }
        }
        #endregion

        #region ==FARBGRP===========
        public static readonly DependencyProperty FARBGRPProperty = DependencyProperty.Register("FARBGRP",
            typeof(string), typeof(UIVAF),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnFARBGRPChanged));
        public string FARBGRP
        {
            get
            {
                return (string)GetValue(FARBGRPProperty);
            }
            set
            {
                SetValue(FARBGRPProperty, value); 
            }
        }
        private static void OnFARBGRPChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIVAF;
            if (src != null)
            {
                src.FARBGRP = (string)e.NewValue;
                src.OnFARBGRPChg((string)e.NewValue);
            }
        }
        public virtual void OnFARBGRPChg(string value)
        {
            if (!IsEdit)
                return;
            TMV.VAFFARBGRP = value.PadRight(1);
        }
        #endregion

        #region ==IsAutoVAF===========
        public static readonly DependencyProperty IsAutoVAFProperty = DependencyProperty.Register("IsAutoVAF",
            typeof(bool), typeof(UIVAF),
            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsAutoVAFChanged));
        public bool IsAutoVAF
        {
            get
            {
                return (bool)GetValue(IsAutoVAFProperty);
            }
            set
            {
                SetValue(IsAutoVAFProperty, value);
            }
        }
        private static void OnIsAutoVAFChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIVAF;
            if (src != null)
            {
                src.IsAutoVAF = (bool)e.NewValue;
            }
        }
        #endregion

        #region ==IsSelfColor===========
        public static readonly DependencyProperty IsSelfColorProperty = DependencyProperty.Register("IsSelfColor",
            typeof(bool), typeof(UIVAF),
            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsSelfColorChanged));
        public bool IsSelfColor
        {
            get
            {
                return (bool)GetValue(IsSelfColorProperty);
            }
            set
            {
                SetValue(IsSelfColorProperty, value);
            }
        }
        private static void OnIsSelfColorChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIVAF;
            if (src != null)
            {
                src.IsSelfColor = (bool)e.NewValue;
            }
        }
        #endregion

        #region ==IsWS15===========
        public static readonly DependencyProperty IsWS15Property = DependencyProperty.Register("IsWS15",
            typeof(bool), typeof(UIVAF),
            new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnIsWS15Changed));
        public bool IsWS15
        {
            get
            {
                return (bool)GetValue(IsWS15Property);
            }
            set
            {
                SetValue(IsWS15Property, value);
            }
        }
        private static void OnIsWS15Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIVAF;
            if (src != null)
            {
                src.IsWS15 = (bool)e.NewValue;
            }
        }
        #endregion

        #region ==LIEFNR===========
        public static readonly DependencyProperty LIEFNRProperty = DependencyProperty.Register("LIEFNR",
        typeof(string), typeof(UIVAF),
        new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnLIEFNRChanged));
        public string LIEFNR
        {
            get
            {
                return (string)GetValue(LIEFNRProperty);
            }
            set
            {
                SetValue(LIEFNRProperty, value);
                OnLIEFNRChg(value);
            }
        }
        private static void OnLIEFNRChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIVAF;
            if (src != null)
            {
                src.LIEFNR = (string)e.NewValue;
            }
        }
        public virtual void OnLIEFNRChg(string ls)
        { }
        #endregion

        #region ==VART===========
        public static readonly DependencyProperty VARTProperty = DependencyProperty.Register("VART",
            typeof(string), typeof(UIVAF),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnVARTChanged));
        public string VART
        {
            get
            {
                return (string)GetValue(VARTProperty);
            }
            set
            {
                SetValue(VARTProperty, value);
                OnVARTChg(value);
            }
        }
        private static void OnVARTChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIVAF;
            if (src != null)
            {
                src.VART = (string)e.NewValue;
            }
        }
        #endregion

        #region ==LSART===========
        public static readonly DependencyProperty LSARTProperty = DependencyProperty.Register("LSART",
            typeof(string), typeof(UIVAF),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnLSARTChanged));
        public string LSART
        {
            get
            {
                return (string)GetValue(LSARTProperty);
            }
            set
            {
                SetValue(LSARTProperty, value);
                OnLSARTChg(value);
            }
        }
        private static void OnLSARTChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIVAF;
            if (src != null)
            {
                src.LSART = (string)e.NewValue;
            }
        }
        #endregion
        #region ==ARTST===========
        public static readonly DependencyProperty ARTSTProperty = DependencyProperty.Register("ARTST",
            typeof(string), typeof(UIVAF),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnARTSTChanged));
        public string ARTST
        {
            get
            {
                return (string)GetValue(ARTSTProperty);
            }
            set
            {
                SetValue(ARTSTProperty, value);
            }
        }
        private static void OnARTSTChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIVAF;
            if (src != null)
            {
                src.ARTST = (string)e.NewValue;
            }
        }
        #endregion

        #region ==WAFBEZ===========
        public static readonly DependencyProperty WAFBEZProperty = DependencyProperty.Register("WAFBEZ",
            typeof(string), typeof(UIVAF),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnWAFBEZChanged));
        public string WAFBEZ
        {
            get
            {
                return (string)GetValue(WAFBEZProperty);
            }
            set
            {
                SetValue(WAFBEZProperty, value);
            }
        }
        private static void OnWAFBEZChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIVAF;
            if (src != null)
            {
                src.WAFBEZ = (string)e.NewValue;
                if (src.TMV.dwMaster == null)
                    return;
                src.TMV.dwMaster["WAFBEZ"]= (string)e.NewValue;
            }
        }
        #endregion
        #region ==WAFGRPBEZ===========
        public static readonly DependencyProperty WAFGRPBEZProperty = DependencyProperty.Register("WAFGRPBEZ",
            typeof(string), typeof(UIVAF),
            new FrameworkPropertyMetadata("", FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnWAFGRPBEZChanged));
        public string WAFGRPBEZ
        {
            get
            {
                return (string)GetValue(WAFGRPBEZProperty);
            }
            set
            {
                SetValue(WAFGRPBEZProperty, value);
            }
        }
        private static void OnWAFGRPBEZChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            var src = sender as UIVAF;
            if (src != null)
            {
                src.WAFGRPBEZ = (string)e.NewValue;
                src.TMV.dwMaster["WAFGRPBEZ"] = (string)e.NewValue;
            }
        }
        #endregion

         
    }
}
